qinglan.Canvas.Trajectory = qinglan.Canvas.RenderInterface.extend(function(id){
	this.id = id;

	this.bulletList = {};

	this.bulletHelper = null;

	this.opt = {};

	this.__useSelfRender = true; 
	
}).methods({
	init: function(){

	},
	setOption: function(opt){
 		this.opt = opt;
	},
	addBullets: function(bullets){
		qinglan.Type.isArray(bullets) ? qinglan.Array.each(bullets,function(bullet){
			this.bulletList[bullet.id] = bullet;
		},this) : (this.bulletList[bullets.id] = bullets);
	},
	setBulletHelper: function(bulletHelper) {
		this.bulletHelper = bulletHelper;
	},
	update: function(ctx){
		qinglan.Object.each(this.bulletList, function(bullet){
			this.bulletHelper.setSprite(bullet);
			this.bulletHelper.update();
			bullet.update(ctx);
		},this);
	},
	draw: function(ctx){
		qinglan.Object.each(this.bulletList, function(bullet){
			qinglan.Canvas.CanvasRender.drawSprite(ctx,bullet);
		});
	},
	destory: function(){
		qinglan.object.each(this.bulletList, function(bullet){
			if(bullet.destory()){
				delete this.bulletList[bullet.id];
			}
		});
	}
}).statics({
 
});
